home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 October / MACPOWER-1997-10.ISO.7z / MACPOWER-1997-10.ISO / AMUG / PROGRAMMING / Mac F2C 1.3.5.sit / Mac F2C 1.3.5 / Mac F2C Libraries / libI77 Sources / sfe.c < prev    next >
Text File  |  1995-01-28  |  793b  |  43 lines

  1. /* sequential formatted external common routines*/
  2. #include "f2c.h"
  3. #include "fio.h"
  4.  
  5. extern char *f__fmtbuf;
  6.  
  7. integer e_rsfe(Void)
  8. {    int n;
  9.     n=en_fio();
  10.     if (f__cf == stdout)
  11.         fflush(stdout);
  12.     else if (f__cf == stderr)
  13.         fflush(stderr);
  14.     f__fmtbuf=NULL;
  15.     return(n);
  16. }
  17. #ifdef KR_headers
  18. c_sfe(a) cilist *a; /* check */
  19. #else
  20. c_sfe(cilist *a) /* check */
  21. #endif
  22. {    unit *p;
  23.     if(a->ciunit >= MXUNIT || a->ciunit<0)
  24.         err(a->cierr,101,"startio");
  25.     p = &f__units[a->ciunit];
  26.     if(p->ufd==NULL && fk_open(SEQ,FMT,a->ciunit)) err(a->cierr,114,"sfe")
  27.     if(!p->ufmt) err(a->cierr,102,"sfe")
  28.     return(0);
  29. }
  30. integer e_wsfe(Void)
  31. {
  32. #ifdef ALWAYS_FLUSH
  33.     int n;
  34.     n = en_fio();
  35.     f__fmtbuf=NULL;
  36.     if (!n && fflush(f__cf))
  37.         err(f__elist->cierr, errno, "write end");
  38.     return n;
  39. #else
  40.     return(e_rsfe());
  41. #endif
  42. }
  43.